from appium.webdriver.common.appiumby import AppiumBy

from src.entity.we_work_app import WeWorkApp


class MainPage(WeWorkApp):
    _CONTACT_BTN = AppiumBy.XPATH, '//android.widget.TextView[@resource-id="com.tencent.wework:id/h8_" and @text="通讯录"]'

    def open_business_nav(self):
        """
        打开公司选择栏
        """
        pass

    def goto_contact(self):
        print("点击【通讯录】按钮")
        self.driver.find_and_click(*self._CONTACT_BTN)

        # 跳转通讯录页面
        self.load_wait()
        from src.page.contact_page import ContactPage
        return ContactPage(self.driver)
